#include <cstdio>
#include <cstring>
#define MAX_T 1000

class CStudent
{
	public:
		char id[100];
		char name[100];
		int score;

		CStudent()
		{
			char empty[] = {'\0'};
			strcpy(id, empty);
			strcpy(name, empty);
			score = 0;
		}

		CStudent(char _id[], char _name[], int _score=0)
		{
			strcpy(id, _id);
			strcpy(name, _name);
			score = _score;
			// Above 3 lines can be simply replaced by call Assign(_id, _name, _score).
		}

		void Assign(char _id[], char _name[], int _score=0)
		{
			strcpy(id, _id);
			strcpy(name, _name);
			score = _score;
		}

		void Introduction()
		{
			printf("Student %s   ID: %s   Score: %d\n", name, id, score);
		}
};

int main()
{
	printf("How many students? ");
	int t;
	scanf("%d", &t);

	CStudent students[MAX_T];
	char name[100], id[100];
	int score;
	printf("Enter student's id, name, score seperate by space:\n");
	for (int idx = 0; idx < t; idx += 1)
	{
		printf("Student %d of %d: ", idx + 1, t);
		scanf("%s %s %d", id, name, &score);
		students[idx].Assign(id, name, score);
		printf("Successful received ");
		students[idx].Introduction();
	}

	int max_score = 0, num = 0;
	int idxs[MAX_T];
	for (int idx = 0; idx < t; idx += 1)
	{
		if (students[idx].score == max_score)
		{
			idxs[num] = idx;
			num += 1;
		}
		else if (students[idx].score > max_score)
		{
			max_score = students[idx].score;
			num = 1;
			idxs[0] = idx;
		}
	}

	printf("\n");
	for (int idx = 0; idx < num; idx += 1)
	{
		students[idxs[idx]].Introduction();
	}

	return 0;
}
